home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 252 / dskpcsrc / clock.def < prev    next >
Text File  |  1988-02-13  |  4KB  |  122 lines

  1. DEFINITION MODULE Clock;
  2.  
  3.    (* This module defines procedures used for manipulating the *)
  4.    (* Clock accessory.                                         *)
  5.  
  6.  
  7.    IMPORT Text;
  8.  
  9.  
  10.    VAR TimerResolution : INTEGER;
  11.  
  12.       (* Defines the minimum timer resolution needed for time events. *)
  13.  
  14.  
  15.    PROCEDURE Initialize ();
  16.  
  17.       (* Initialize the clock upon system power-up *)
  18.  
  19.  
  20.    PROCEDURE DayPeriod () : BOOLEAN;
  21.  
  22.       (* Return TRUE if the current time is between 8:00 am and *)
  23.       (* 4:59 pm inclusive, otherwise return FALSE.             *)
  24.  
  25.  
  26.    PROCEDURE EveningPeriod () : BOOLEAN;
  27.  
  28.       (* Return TRUE if the current time is between 5:00 pm and *)
  29.       (* 10:59 pm inclusive, otherwise return FALSE.            *)
  30.  
  31.  
  32.    PROCEDURE NightPeriod () : BOOLEAN;
  33.  
  34.       (* Return TRUE if the current time is between 11:00 pm and *)
  35.       (* 7:59 am inclusive, otherwise return FALSE.              *)
  36.  
  37.  
  38.    PROCEDURE SetTime ();
  39.  
  40.       (* Invoke a dialog box allowing the user to set the time. *)
  41.  
  42.  
  43.    PROCEDURE SetDate ();
  44.  
  45.       (* Invoke a dialog box allowing the user to set the date. *)
  46.  
  47.  
  48.    PROCEDURE OwnsWindow ( WindowId : INTEGER ) : BOOLEAN;
  49.  
  50.       (* Return TRUE if the clock owns the window specified by *)
  51.       (* "WindowId", or FALSE otherwise.                       *)
  52.  
  53.  
  54.    PROCEDURE DecodeTime ( Time              : CARDINAL;
  55.                           UseFormat         : BOOLEAN;
  56.                           VAR FormattedTime : ARRAY OF CHAR ); 
  57.  
  58.       (* Convert "Time" from it's encoded representation into *)
  59.       (* the text string "FormattedTime".                     *)
  60.  
  61.  
  62.    PROCEDURE DecodeDate ( Date              : CARDINAL;
  63.                           UseFormat         : BOOLEAN;
  64.                           VAR FormattedDate : ARRAY OF CHAR );
  65.  
  66.       (* Convert "Date" from it's encoded representation into *)
  67.       (* the text string "FormattedDate".                     *)
  68.  
  69.  
  70.    PROCEDURE EncodeTime ( VAR FormattedTime : ARRAY OF CHAR;
  71.                           PM                : BOOLEAN;
  72.                           VAR Time          : CARDINAL ) : BOOLEAN;
  73.  
  74.  
  75.       (* Convert "FormattedTime" from a text string into the encoded *)
  76.       (* representation "Time".                                      *)
  77.  
  78.  
  79.    PROCEDURE EncodeDate ( VAR FormattedDate : ARRAY OF CHAR;
  80.                           VAR Date          : CARDINAL ) : BOOLEAN;
  81.  
  82.       (* Convert "FormattedDate" from a text string into the encoded *)
  83.       (* representation "Date".                                      *)
  84.  
  85.  
  86.    PROCEDURE Open;
  87.  
  88.       (* Open the clock.  If the clock is already opened, *)
  89.       (* then top the window belonging to the clock.      *)
  90.  
  91.  
  92.    PROCEDURE Close;
  93.  
  94.       (* Close the clock window. *)
  95.  
  96.  
  97.    PROCEDURE ProcessTimerEvent;
  98.  
  99.       (* The time specified has elapsed, so process the event. *)
  100.  
  101.  
  102.    PROCEDURE ProcessMessageEvent ( VAR MsgBuffer : ARRAY OF INTEGER );
  103.  
  104.       (* Process a message event not relating to a menu. *)
  105.  
  106.  
  107.    PROCEDURE ProcessButtonEvent ( MouseButton : INTEGER;
  108.                                   ModifierKey : INTEGER;
  109.                                   Clicks      : INTEGER );
  110.  
  111.       (* The mouse button has been pressed, so process the event. *)
  112.  
  113.  
  114.    PROCEDURE ProcessKeyboardEvent ( Key         : INTEGER;
  115.                                     ModifierKey : INTEGER );
  116.  
  117.       (* A key on the keyboard has been pressed, so process the event. *)
  118.  
  119.  
  120. END Clock.
  121.  
  122.